import React, { Component } from 'react'
import './index.css'
export default class Item extends Component {

  render() {
    
    let {item,deleteById,changeChecked} = this.props
    return (
        <li>
            <label>
            <input type="checkbox" checked={item.isDone} onChange={()=> changeChecked(item.id)}/>
            <span>{item.title}</span>
            </label>
            <button className="btn btn-danger" onClick={()=> deleteById(item.id)}>删除</button>
        </li>
    )
  }
}
